(function(e,t){"use strict";function n(){var e=babelHelpers.taggedTemplateLiteral(['\n\t\t<div class="main-ui-loader main-ui-hide">\n\t\t\t<svg class="main-ui-loader-svg" viewBox="25 25 50 50">\n\t\t\t\t<circle class="main-ui-loader-svg-circle" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10">\n\t\t\t</svg>\n\t\t</div>\n\t']);n=function t(){return e};return e}function i(){var e=t.Tag.render(n());var i=e.querySelector(".main-ui-loader-svg-circle");return{container:e,circle:i}}function a(){var e=babelHelpers.taggedTemplateLiteral(["\n\t\t\t\tdata-is-shown: false;\n\t\t\t"]);a=function t(){return e};return e}function r(){var e=babelHelpers.taggedTemplateLiteral(["\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t"]);r=function t(){return e};return e}function s(){var e=babelHelpers.taggedTemplateLiteral(["\n\t\t\t\tdisplay: null;\n\t\t\t"]);s=function t(){return e};return e}function o(){var e=babelHelpers.taggedTemplateLiteral(["\n\t\t\t\tdata-is-shown: true;\n\t\t\t"]);o=function t(){return e};return e}function l(e){if(!t.Type.isDomNode(e)){return Promise.reject(new Error("element is not Element"))}return new Promise(function(n){if(e.dataset.isShown==="false"||!e.dataset.isShown){var i=function i(a){if(a.animationName==="showMainLoader"){t.Event.unbind(e,"animationend",i);n(a)}};t.Event.bind(e,"animationend",i);t.Tag.attrs(e)(o());t.Tag.style(e)(s());t.Dom.removeClass(e,"main-ui-hide");t.Dom.addClass(e,"main-ui-show")}})}function u(e){if(!t.Type.isDomNode(e)){return Promise.reject(new Error("element is not Element"))}return new Promise(function(n){if(e.dataset.isShown==="true"){var i=function i(a){if(a.animationName==="hideMainLoader"){t.Tag.style(e)(r());t.Event.unbind(e,"animationend",i);n(a)}};t.Event.bind(e,"animationend",i);t.Tag.attrs(e)(a());t.Dom.removeClass(e,"main-ui-show");t.Dom.addClass(e,"main-ui-hide")}})}var c={size:110};var d="ready";var f="shown";var m="hidden";var v=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);babelHelpers.defineProperty(this,"data",i());babelHelpers.defineProperty(this,"state",d);babelHelpers.defineProperty(this,"currentTarget",null);var n=babelHelpers.objectSpread({},c,t);this.currentTarget=n.target;this.setOptions(n)}babelHelpers.createClass(e,[{key:"createLayout",value:function e(){return this.layout}},{key:"show",value:function e(){var n=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;return new Promise(function(){var e=i||n.currentTarget;if(t.type.isDomNode(e)&&e!==n.layout.parentNode){n.currentTarget=e;t.append(n.layout,e)}if(n.state!==f){n.state=f;return l(n.layout)}return false})}},{key:"hide",value:function e(){var t=this;return new Promise(function(){if(t.state!==m){t.state=m;return u(t.layout)}return false})}},{key:"isShown",value:function e(){return this.state===f}},{key:"destroy",value:function e(){t.remove(this.layout)}},{key:"setOptions",value:function e(n){var i=this;var a=n.target,r=n.size,s=n.color,o=n.offset,l=n.mode;var u=new Map;var c=new Map;if(t.type.isDomNode(a)){this.currentTarget=a}if(t.type.isNumber(r)){u.set("width","".concat(r,"px"));u.set("height","".concat(r,"px"))}if(t.type.isString(s)){c.set("stroke",s)}if(t.type.isObjectLike(o)){var d=/^inline$|^custom$/.test(l)?"":"margin-";if(t.type.isString(o.top)){u.set("".concat(d,"top"),o.top)}if(t.type.isString(o.left)){u.set("".concat(d,"left"),o.left)}}if(l==="inline"){t.addClass(this.layout,"main-ui-loader-inline")}else{t.removeClass(this.layout,"main-ui-loader-inline")}if(l==="custom"){t.addClass(this.layout,"main-ui-loader-custom");t.removeClass(this.layout,"main-ui-loader-inline")}u.forEach(function(e,t){i.layout.style[t]=e});c.forEach(function(e,t){i.circle.style[t]=e})}},{key:"layout",get:function e(){return this.data.container}},{key:"circle",get:function e(){return this.data.circle}}]);return e}();e.Loader=v})(this.BX=this.BX||{},BX);
//# sourceMappingURL=loader.bundle.map.js